%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Radial wave function of hydrogen.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function QA_Rotacao_Laguerre

	Constant;
	figure(1);				clf;

	r     =[0:.001:1]*aB*25;
	psi100=1/sqrt(pi)		*aB^(-3/2)							.*exp(-r/aB);
	psi200=1/4/sqrt(2*pi)	*aB^(-3/2)*(2-r/aB)					.*exp(-r/2/aB);
	psi210=1/4/sqrt(2*pi)	*aB^(-3/2)*r/aB						.*exp(-r/2/aB);
	psi300=1/81/sqrt(3*pi)	*aB^(-3/2)*(27-18*r/aB+2*r.^2/aB^2)	.*exp(-r/3/aB);
	psi310=1/81/sqrt(pi/2)	*aB^(-3/2)*(6-r/aB).*r/aB			.*exp(-r/3/aB);
	psi320=1/81/sqrt(6*pi)	*aB^(-3/2)*r.^2/aB^2				.*exp(-r/3/aB);
	
	n=1;		l=0;		m=0;
 	rho =2*r/n/aB;			Rnlm=(1/n/aB)^1.5*rho.^l.*exp(-rho/2).*Laguerre(rho,n+l,2*l+1);

	subplot(2,2,1),plot(r/aB,aB^1.5*Rnlm,'-k',r/aB,aB^1.5*psi100,'-r',r/aB,aB^1.5*psi200,':g',r/aB,aB^1.5*psi300,'-.b')
	set(gca,'xLim',[0 max(r)/aB],'FontSize',16,'LineWidth',1.4)
	xlabel('\fontsize{16}{\itr/a_B}')
	ylabel('\fontsize{16}{\ita_B}^{3/2} {\itR}({\itr})')
 	subplot(2,2,2),plot(r/aB,aB*abs(psi100.*r).^2,'-r',r/aB,aB*abs(psi200.*r).^2,':g',r/aB,aB*abs(psi300.*r).^2,'-.b')
	set(gca,'xLim',[0 max(r)/aB],'FontSize',16,'LineWidth',1.4)
	xlabel('\fontsize{16}{\itr/a_B}')
	ylabel('\fontsize{16}{\ita_B} [{\itrR}({\itr})]^2')
	text(1,.02,'\fontsize{12}\langle r_{10} \rangle')
	text(1,.02,'\fontsize{12}\langle r_{20} \rangle')
	text(1,.02,'\fontsize{12}\langle r_{30} \rangle')
	subplot(2,2,3),plot(r/aB,aB^1.5*psi300,'-r',r/aB,aB^1.5*psi310,':g',r/aB,aB^1.5*psi320,'-.b')
	set(gca,'xLim',[0 max(r)/aB],'FontSize',16,'LineWidth',1.4)
	xlabel('\fontsize{16}{\itr/a_B}')
	ylabel('\fontsize{16}{\ita_B}^{3/2} {\itR}({\itr})')
 	subplot(2,2,4),plot(r/aB,aB*abs(psi300.*r).^2,'-r',r/aB,aB*abs(psi310.*r).^2,':g',r/aB,aB*abs(psi320.*r).^2,'-.b')
	set(gca,'xLim',[0 max(r)/aB],'FontSize',16,'LineWidth',1.4)
	xlabel('\fontsize{16}{\itr/a_B}')
	ylabel('\fontsize{16}{\ita_B} [{\itrR}({\itr})]^2')
	text(1,.02,'\fontsize{12}\langle r_{30} \rangle')
	text(1,.02,'\fontsize{12}\langle r_{31} \rangle')
	text(1,.02,'\fontsize{12}\langle r_{32} \rangle')
end


function L = Laguerre(x,n,m)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Modified Laguerre polynomials for integer numbers.

	L=0;
	for k=0:n
		L=L+prod(1:n+m)./prod(1:k+m)./prod(1:n-k)./prod(1:k).*(-x).^k;
	end
end
